package com.hero.jobweb.action.interceptor;

import java.util.Map;

import com.hero.jobweb.config.SystemKey;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;



/**
 * 登陆拦截器
 * @author Volcano
 *
 */
public class PersonalLoginInterceptor extends AbstractInterceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String intercept(ActionInvocation ai) throws Exception {
		Map<String, Object> sessionMap=ai.getInvocationContext().getSession();
		if(sessionMap.get(SystemKey.PERSONAL_USER)==null)
		{
			return Action.LOGIN;
		}
		return ai.invoke();
	}

}
